package com.lin.nio.utils;

import java.nio.ByteBuffer;

public class ByteBufferUtil {

    /**
     * 打印所有内容
     * @param buffer
     */
    public static String debugAll(ByteBuffer buffer) {
        buffer.flip();
        byte[] dst = new byte[buffer.limit()];
        buffer.get(dst);
        buffer.clear();
        return new String(dst);
    }
}
